/**
 * Dear programmer:
 * When I wrote this code, only god and I knew how it worked.
 * Now, only god knows it!
 *
 * @author: Pegasus  Date: 2019-02-13 Time: 23:07
 */

import {Action} from "../../../configuration/ActionCreator"
import {requestLogin,requestOffWork,requestRedPoint,requestCreateFtpTimer,requestSetAlinarg,requestSetButtonRight} from "../../../request/LoginRequest"
import {requestSetCache} from "../../../request/LoginRequest"

/**
 * 登录
 * @type {string}
 */
export const Login = 'Login';
export const doLogin = (username, password, hotelId) => {
  let action = Action(Login);
  return dispatch => dispatch(requestLogin(action, username, password, hotelId))
}

/**
 * 获取数据
 * @hotelId {string}
 */
export const Cache='Cache';
export const doCache = (hotelId) => {
    let action = Action(Cache);
    return dispatch => dispatch(requestSetCache(action,hotelId))
}

/**
 * 获取数据
 * @hotelId {string}
 */
export const Alinarg='Alinarg';
export const doAlinarg = (hotelId) => {
    let action = Action(Alinarg);
    return dispatch => dispatch(requestSetAlinarg(action,hotelId))
}

export const ButtonRight='ButtonRight';
export const doButtonRight = (hotelId) => {
    let action = Action(ButtonRight);
    return dispatch => dispatch(requestSetButtonRight(action,hotelId))
}


/**
 * 下班
 * @type {string}
 */
export const OffWork = 'OffWork';
export const offWork = (str) => {
    let action = Action(OffWork);
    return dispatch => dispatch(requestOffWork(action, str))
}


/**
 * 客房管家主页红点
 * @type {string}
 */
export const WHSKMenuMain = 'WHSKMenuMain';
export const whskMenuMain = () => {
    let action = Action(WHSKMenuMain);
    return dispatch => dispatch(requestRedPoint(action))
}

/**
 * 客房管家主页红点
 * @type {string}
 */
export const CreateFtpTimer = 'CreateFtpTimer';
export const createFtpTimer = () => {
    let action = Action(CreateFtpTimer);
    return dispatch => dispatch(requestCreateFtpTimer(action))
}


